package org.pictual.controller.mainPackage;

public class MyParser {

protected int advanceChars(String line, int indexBegin, int n, String chars){
        int count = 0;
        if(n < 1){
            return -1;
        }

        for(int i = indexBegin ; i < line.length() ; i++){
            if(line.regionMatches(i, chars, 0, chars.length())){
                count++;
                if(count == n){
                    //return i + chars.length();
                    return i;
                }
            }
        }
        return -1;
    }
    protected String extractField(String line, int beginPos){
        int endPos = line.indexOf("\"", beginPos);
        return line.substring(beginPos,endPos);
    }
}
